package com.rk.kbk.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rk.kbk.common.DateJsonDeserializer;
import com.rk.kbk.common.DateJsonSerializer;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @OpenArea
 * @开通地区(open_area)
 * @version : Ver 1.0
 */
@Entity
public class WithdrawMesg implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * @备注:银行卡
     * @字段:id BIGINT(33)
     */
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @GenericGenerator(name="auto-identity",strategy="identity")
    @Column(updatable = false, columnDefinition="BIGINT(33) COMMENT '银行卡'")
    private Long id;

    /**
     * @备注:用户id
     * @字段:user_id VARCHAR(255)
     */
    @Column(columnDefinition="BIGINT(33) COMMENT '省'")
    private Long userId;

    /**
     * @备注:持卡人姓名
     * @字段:real_name VARCHAR(255)
     */
    @Column(columnDefinition="VARCHAR(255) COMMENT '持卡人姓名'")
    private String  realName;

    /**
     * @备注:卡号
     * @字段:bank_num VARCHAR(255)
     */
    @Column(columnDefinition="VARCHAR(255) COMMENT '卡号'")
    private String  bankNum;

    /**
     * @备注:银行名称
     * @字段:bank_name VARCHAR(255)
     */
    @Column(columnDefinition="VARCHAR(255) COMMENT '银行名称'")
    private String  bankName;


    /**
     * @备注:预留手机号

     * @字段:obligate_mobile String(255)
     */
    @Column(columnDefinition="VARCHAR(255) COMMENT '预留手机号'")
    private String  obligateMobile;

    /**
     * @备注:
     * @字段:gmt_datetime DATETIME(19)
     */
    @Column(updatable = false, columnDefinition="DATETIME(19) COMMENT ''")
    @JsonSerialize(using=DateJsonSerializer.class)
    @JsonDeserialize(using=DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    private Date gmtDatetime = new Date();

    /**
     * @备注:
     * @字段:upt_datetime DATETIME(19)
     */
    @Column(columnDefinition="DATETIME(19) COMMENT ''")
    @JsonSerialize(using=DateJsonSerializer.class)
    @JsonDeserialize(using=DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    private Date uptDatetime = new Date();

    public WithdrawMesg(){
    }

    public WithdrawMesg(
            Long id
    ){
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getBankNum() {
        return bankNum;
    }

    public void setBankNum(String bankNum) {
        this.bankNum = bankNum;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getObligateMobile() {
        return obligateMobile;
    }

    public void setObligateMobile(String obligateMobile) {
        this.obligateMobile = obligateMobile;
    }

    public Date getGmtDatetime() {
        return gmtDatetime;
    }

    public void setGmtDatetime(Date gmtDatetime) {
        this.gmtDatetime = gmtDatetime;
    }

    public Date getUptDatetime() {
        return uptDatetime;
    }

    public void setUptDatetime(Date uptDatetime) {
        this.uptDatetime = uptDatetime;
    }
}
